<template>
	<view class="pr">

		<scroll-list ref="list" :option="option" @load="load" @refresh="refresh">
			<view class="he mlr30 mt20" v-for="(item,index) in list" :key="index">
				<view class="mlr30 pt20">
					<view class="flexR ">
						<image class="tx br50" :src="item.coach_img" mode=""></image>
						<view class="flexC ml10">
							<view class="fw600">{{item.coach_name}}</view>
							<view class="c6 mt5">{{item.create_time | fengetime}}</view>
						</view>
					</view>
					<view class="mt10 c9">任务名称</view>
					<view class="">{{item.patrol_name}}</view>
					<view class="mt20 c9">任务内容</view>
					<view class="">{{item.patrol_content}}</view>
					<view class="mt20 c9">备注</view>
					<view class="">{{item.remark}}</view>
					<view class="flexR mt20 flex-wrap flex-between">
						<image @click="yulantu(item.imgs)" class="tp mr20 mb20" style="width: 200rpx;height: 150rpx;"
							:src="item.imgs" mode="widthFix"></image>
					</view>
				</view>
			</view>
		</scroll-list>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [],
				page:0,
				option: {
					size: 10,
					auto: true
				},
			}
		},
		onLoad(option) {
			uni.setNavigationBarTitle({
				title: "巡查日志"
			})
		},
		methods: {
			// 加载数据
			load(paging) {
				var that = this
				that.page = that.page + 1
				setTimeout(() => {
					var json = {
						page: that.page
					}
					that.$http.post(that.$config.UrlPostxcRizhi, json).then((res) => {
						if (res.status == 1) {
							var list = res.data.list
							if(list){
								var totalDemo = that.list.concat(list);
								that.list = JSON.parse(JSON.stringify(totalDemo))
								that.$refs.list.loadSuccess({ list: that.list, total: res.data.count });
							}
						}
					})
					
				}, that.$u.random(100, 1000));
			},
			yulantu(img){
				var arr = []
				arr.push(img)
				this.$api.previewImage(0,arr)
			}
		}
	}
</script>

<style scoped>
	.xian {
		height: 3rpx;

		background-color: #e7e7e7;
	}

	.he1 {
		border-radius: 10rpx;
		line-height: 80rpx;
		width: 600rpx;
		background-color: #1F73F2;
		height: 80rpx;

	}

	.tp1 {
		width: 24rpx;
		height: 24rpx;
	}

	.tp {
		height: 156rpx;
		width: 156rpx;
	}

	.tx {
		height: 84rpx;
		width: 84rpx;
	}

	.he {
		opacity: 1;
		background: #ffffff;
		border-radius: 20rpx;
		box-shadow: 3rpx 5rpx 13rpx 0rpx rgba(0, 0, 0, 0.2);
	}
</style>
